package ooday03;

import java.rmi.Naming;

public class Test {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑", 3, "黑色");
        dogs[1] = new Dog("小白", 1, "白色");
        dogs[2] = new Dog("大奔", 7, "黄色");
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
            dogs[i].swim();
        }
        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("小坤", 29, "黑色");
        chicks[1] = new Chick("小鸡", 3, "黄色");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].layEggs();
        }
        Fish[] fishs = new Fish[2];
        fishs[0] = new Fish("花花", 1, "银色");
        fishs[1] = new Fish("金", 2, "黄金");
        for (int i = 0; i < fishs.length; i++) {
            System.out.println(fishs[i].name);
            fishs[i].eat();
        }
    }
}
